http: improve parser error messages#28487
Closed
addaleax wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
Include the library-provided reason in the Error’s `message`. Fixes: nodejs#28468
Member
|
Fantastic! |
antsmartian
approved these changes
Jul 1, 2019
danbev
approved these changes
Jul 1, 2019
Trott
approved these changes
Jul 1, 2019
BridgeAR
approved these changes
Jul 1, 2019
Collaborator
cjihrig
approved these changes
Jul 1, 2019
Collaborator
trivikr
approved these changes
Jul 1, 2019
| const req = http.get(`http://localhost:${server.address().port}/`); | ||
| req.end(); | ||
| req.on('error', common.mustCall((err) => { | ||
| const reason = 'Content-Length can\'t be present with chunked encoding'; |
Member
There was a problem hiding this comment.
nit: backticks instead of single quotes to avoid escaping
Suggested change
| const reason = 'Content-Length can\'t be present with chunked encoding'; | |
| const reason = `Content-Length can't be present with chunked encoding`; |
Member
There was a problem hiding this comment.
As note: using backticks would not be accepted by eslint. Only double quotes would be accepted. Using backticks is only accepted by eslint if the template string contains a variable.
Collaborator
Member
|
Landed in ba565a3 |
Trott
pushed a commit
to Trott/io.js
that referenced
this pull request
Jul 6, 2019
Include the library-provided reason in the Error’s `message`. Fixes: nodejs#28468 PR-URL: nodejs#28487 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
targos
pushed a commit
that referenced
this pull request
Jul 20, 2019
Include the library-provided reason in the Error’s `message`. Fixes: #28468 PR-URL: #28487 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This was referenced Jul 23, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Include the library-provided reason in the Error’s
message.Fixes: #28468
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes